package com.my.service.impl;

import com.my.mapper.DepartmentMapper;
import com.my.pojo.Department;
import com.my.service.DepartmentService;
import com.my.util.MyBatisUtil;
import com.my.vo.DepartmentVo;

import java.util.List;

public class DepartmentServiceImpl implements DepartmentService {
    DepartmentMapper departmentMapper = MyBatisUtil.openSession().getMapper(DepartmentMapper.class);


    public List<DepartmentVo> getAllDepartment() {
        return departmentMapper.getAllDepartment();
    }

    public boolean deleteDepartmentById(Integer departId) {
        return departmentMapper.deleteDepartmentById(departId);
    }

    public List<DepartmentVo> getDepartmentBy(Department department) {
        return departmentMapper.getDepartmentBy(department);
    }

    public DepartmentVo getDepartmentById(Integer departId) {
        return departmentMapper.getDepartmentById(departId);
    }

    public boolean addDepartment(Department department) {
        return departmentMapper.addDepartmentBy(department);
    }
}
